<template>
  <div>
    <base-info-t v-if="projectClass == '10'  && projectType != 'TE'" ref="baseInfoT" :project-build-id="projectBuildId"
      :sel-project-type="projectType"
      :change-id="changeId" />
    <base-info-te
      v-if="projectClass == '10' && projectType == 'TE'"
      ref="baseInfoTe"
      :project-build-id="projectBuildId"
      :sel-project-type="projectType"
      :change-id="changeId"
    />
    <base-info-e v-if="projectClass == '20' && (projectType == 'EA' || projectType == 'EB' )" ref="baseInfoE" :project-build-id="projectBuildId"
        :sel-project-type="projectType" :change-id="changeId" />
    <base-info-e-c v-if="projectClass == '20' && projectType == 'EC'" ref="baseInfoEC" :project-build-id="projectBuildId"
        :sel-project-type="projectType" :change-id="changeId" />
    <base-info-e-d v-if="projectClass == '20' && projectType == 'ED'" ref="baseInfoED" :project-build-id="projectBuildId"
        :sel-project-type="projectType" :change-id="changeId" />
    <base-info-f v-if="projectClass == '30'" :isOld="isOld" ref="baseInfoF" :project-build-id="projectBuildId" :change-id="changeId" />
    <base-info-g v-if="projectClass == '40'" ref="baseInfoG" :project-build-id="projectBuildId"
      :sel-project-type="projectType"
      :change-id="changeId" />
    <base-info-gf v-if="projectClass == '41'" ref="baseInfoGf" :project-build-id="projectBuildId" :sel-project-type="projectType" :change-id="changeId" />
    <base-info-h v-if="projectClass == '50'" ref="baseInfoH" :project-build-id="projectBuildId" :change-id="changeId" />
    <base-info-m-company
      v-if="projectClass == '64'"
      ref="baseInfoMCompany"
      :project-build-id="projectBuildId"
      :sel-project-type="projectType"
      :change-id="changeId"
    />
    <base-info-m-a
      v-if="projectClass == '60'"
      ref="baseInfoMA"
      :project-build-id="projectBuildId"
      :sel-project-type="projectType"
      :sel-project-class="projectClass"
      :change-id="changeId"
    />
    <base-info-m-b
      v-if="projectClass == '61'"
      ref="baseInfoMB"
      :project-build-id="projectBuildId"
      :sel-project-type="projectType"
      :sel-project-class="projectClass"
      :change-id="changeId"
    />
    <base-info-m-manage
      v-if="(projectClass == '62' && projectType != 'MG') || projectClass == '63'"
      ref="baseInfoMManage"
      :project-build-id="projectBuildId"
      :sel-project-type="projectType"
      :sel-project-class="projectClass"
      :change-id="changeId"
    />
    <base-info-m-g v-if="projectClass == '62' && projectType == 'MG' " ref="baseInfoMg" :project-build-id="projectBuildId" :sel-project-type="projectType" :change-id="changeId"></base-info-m-g>
    <base-info-m-f v-if="projectClass == '65'" ref="baseInfoMF" :project-build-id="projectBuildId" :change-id="changeId" />
    <base-info-j v-if="projectClass == '70'" ref="baseInfoJ" :project-build-id="projectBuildId" :change-id="changeId" />
    <base-info-p v-if="projectClass == '80' && projectType == 'PA'" ref="baseInfoP" :project-build-id="projectBuildId" :change-id="changeId" :sel-project-type="projectType"/>
    <base-info-p-b v-if="projectClass == '80' && projectType == 'PB'" ref="baseInfoPb" :project-build-id="projectBuildId" :change-id="changeId" :sel-project-type="projectType"/>
    <base-info-l-a v-if="['81','82','83'].includes(projectClass)" ref="baseInfoL" :project-build-id="projectBuildId" :change-id="changeId" :sel-project-class="projectClass" />
    <base-info-s v-if="projectClass == '90'" ref="baseInfoS" :project-build-id="projectBuildId" :change-id="changeId" />
  </div>
</template>
<script>
import { strNotNull } from '@/utils/common.js'
import { getAction } from '../../api/manage'
export default {
  components: {
    BaseInfoT: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoT'),
    BaseInfoTe: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoTe'),
    BaseInfoE: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoE'),
    BaseInfoF: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoF'),
    BaseInfoG: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoG'),
    BaseInfoH: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoH'),
    BaseInfoMManage: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoMManage'),
    BaseInfoMCompany: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoMCompany'),
    BaseInfoJ: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoJ'),
    BaseInfoP: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoP'),
    BaseInfoPB: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoPB'),
    BaseInfoS: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoS'),
    BaseInfoGf: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoGf'),
    BaseInfoMF: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoMF'),
    BaseInfoEC: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoEC'),
    BaseInfoMG: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoMG'),
    BaseInfoMA: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoMA'),
    BaseInfoED: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoED'),
    BaseInfoMB: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoMB'),
    BaseInfoLA: () => import('@/components/tools/projectBuildStup/baseInfo/BaseInfoLA'),
  },
  data() {
    return {
      projectBuildId: '',
      projectClass: '',
      projectType: '',
      changeId: '',
      isOld:false ,
      currentAudit: false,
      url:{
        getProjectBuild:'/projectBuild/queryById',
        jugeDate:'/projectMemberEvaluate/jugeDate' ,
      },
    }
  },
  methods: {
    jugeDate(){
      if (this.projectBuildId == undefined){
        this.isOld = false;
        return
      }
      getAction(this.url.jugeDate , {projectBuildId: this.projectBuildId}).then( res => {
        if (res.code == 200){
          this.isOld = false;
        }
        else {
          this.isOld = true;
        }
      })
    },
    getProjectBuild() {
      if (this.projectBuildId == null || this.projectBuildId == '') {
        return;
      }
      getAction(this.url.getProjectBuild, { id: this.projectBuildId })
        .then((res) => {
          if (res.code == 200) {
            this.projectClass = res.result.projectClass
            this.projectType = res.result.projectType
          } else {
            this.$message.warning('查询立项信息失败:' + res.message)
          }
        })
        .catch((res) => {
          this.$message.warning('查询立项信息失败:' + res.message)
        })
    },
  },
  mounted() {
    this.projectBuildId = this.$route.query.projectBuildId
    this.projectClass = this.$route.query.projectClass
    this.projectType = this.$route.query.projectType
    this.changeId = this.$route.query.changeId
    this.currentAudit = this.$route.query.currentAudit
    if (!strNotNull(this.projectClass) || !strNotNull(this.projectType)) {
      this.getProjectBuild()
    }

    this.jugeDate();
  },
}
</script>
<style lang="less" scoped>
  @import '~@assets/less/hte-main.less';
</style>